//
//  MoreSecondCell.swift
//  SwiftOfXiaoShouJia
//
//  Created by zhenjingxiong on 2018/9/5.
//  Copyright © 2018年 镇景雄. All rights reserved.
//

import UIKit

class MoreSecondCell: UITableViewCell {

    override func awakeFromNib() {
        super.awakeFromNib()
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.layoutUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func layoutUI() {
        self.selectionStyle = UITableViewCellSelectionStyle.none
        
        //改变左边图标
        self.addSubview(self.leftImageView)
        self.leftImageView.snp.makeConstraints { (make) in
            make.centerY.equalTo(self)
            make.left.equalTo(20)
        }
        
        //添加左边的文字
        self.addSubview(self.leftLabel)
        self.leftLabel.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.leftImageView)
            make.left.equalTo(self.leftImageView.snp.right).offset(20)
        }
        
        //添加箭头
        self.addSubview(self.arrowImageView)
        self.arrowImageView.snp.makeConstraints { (make) in
            make.centerY.equalTo(self)
            make.right.equalTo(self).offset(-20)
        }
        
    }

    lazy var leftImageView: UIImageView = {
        let leftImageView = UIImageView.init(image: UIImage.init(named: "icon_more_achievement"))
        return leftImageView
    }()
    
    lazy var leftLabel: UILabel = {
        let leftLabel = UILabel.init()
        leftLabel.text = "我的业绩"
        leftLabel.font = UIFont.systemFont(ofSize: 16)
        return leftLabel
    }()
    
    lazy var arrowImageView: UIImageView = {
        let arrowImageView = UIImageView.init(image: UIImage.init(named: "icon_arrow"))
        return arrowImageView
    }()

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
